using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class POOrderEntryMap : EntityTypeConfiguration<POOrderEntry>
    {
        public POOrderEntryMap()
        {
            // Primary Key
            this.HasKey(t => t.FDetailID);

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FMapNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMapName)
                .HasMaxLength(256);

            this.Property(t => t.FSourceBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FContractBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FMTONo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FEntrySelfP0248)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfP0249)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfP0252)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfP0253)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("POOrderEntry");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FCommitQty).HasColumnName("FCommitQty");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FTaxRate).HasColumnName("FTaxRate");
            this.Property(t => t.FTax).HasColumnName("FTax");
            this.Property(t => t.FTaxAmount).HasColumnName("FTaxAmount");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxCommitQty).HasColumnName("FAuxCommitQty");
            this.Property(t => t.FAuxPrice).HasColumnName("FAuxPrice");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FSourceEntryID).HasColumnName("FSourceEntryID");
            this.Property(t => t.FCess).HasColumnName("FCess");
            this.Property(t => t.FStockQty).HasColumnName("FStockQty");
            this.Property(t => t.FAuxStockQty).HasColumnName("FAuxStockQty");
            this.Property(t => t.FMapNumber).HasColumnName("FMapNumber");
            this.Property(t => t.FMapName).HasColumnName("FMapName");
            this.Property(t => t.FAllAmount).HasColumnName("FAllAmount");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FAuxPriceDiscount).HasColumnName("FAuxPriceDiscount");
            this.Property(t => t.FPriceDiscount).HasColumnName("FPriceDiscount");
            this.Property(t => t.FQtyInvoice).HasColumnName("FQtyInvoice");
            this.Property(t => t.FQtyInvoiceBase).HasColumnName("FQtyInvoiceBase");
            this.Property(t => t.FAuxTaxPrice).HasColumnName("FAuxTaxPrice");
            this.Property(t => t.FTaxPrice).HasColumnName("FTaxPrice");
            this.Property(t => t.FReceiveAmountFor_Commit).HasColumnName("FReceiveAmountFor_Commit");
            this.Property(t => t.FReceiveAmount_Commit).HasColumnName("FReceiveAmount_Commit");
            this.Property(t => t.FSecCoefficient).HasColumnName("FSecCoefficient");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FSecCommitQty).HasColumnName("FSecCommitQty");
            this.Property(t => t.FSourceTranType).HasColumnName("FSourceTranType");
            this.Property(t => t.FSourceInterId).HasColumnName("FSourceInterId");
            this.Property(t => t.FSourceBillNo).HasColumnName("FSourceBillNo");
            this.Property(t => t.FContractInterID).HasColumnName("FContractInterID");
            this.Property(t => t.FContractEntryID).HasColumnName("FContractEntryID");
            this.Property(t => t.FContractBillNo).HasColumnName("FContractBillNo");
            this.Property(t => t.FMRPLockFlag).HasColumnName("FMRPLockFlag");
            this.Property(t => t.FAuxQtyInvoice).HasColumnName("FAuxQtyInvoice");
            this.Property(t => t.FMrpClosed).HasColumnName("FMrpClosed");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FMapID).HasColumnName("FMapID");
            this.Property(t => t.FSProducingAreaID).HasColumnName("FSProducingAreaID");
            this.Property(t => t.FAmtDiscount).HasColumnName("FAmtDiscount");
            this.Property(t => t.FCheckAmount).HasColumnName("FCheckAmount");
            this.Property(t => t.FMrpAutoClosed).HasColumnName("FMrpAutoClosed");
            this.Property(t => t.FPayApplyAmountFor_Commit).HasColumnName("FPayApplyAmountFor_Commit");
            this.Property(t => t.FPayApplyAmount_Commit).HasColumnName("FPayApplyAmount_Commit");
            this.Property(t => t.FSecStockQty).HasColumnName("FSecStockQty");
            this.Property(t => t.FSecInvoiceQty).HasColumnName("FSecInvoiceQty");
            this.Property(t => t.FPlanMode).HasColumnName("FPlanMode");
            this.Property(t => t.FMTONo).HasColumnName("FMTONo");
            this.Property(t => t.FDescount).HasColumnName("FDescount");
            this.Property(t => t.FEntrySelfP0248).HasColumnName("FEntrySelfP0248");
            this.Property(t => t.FEntrySelfP0247).HasColumnName("FEntrySelfP0247");
            this.Property(t => t.FEntrySelfP0249).HasColumnName("FEntrySelfP0249");
            this.Property(t => t.FEntrySelfP0250).HasColumnName("FEntrySelfP0250");
            this.Property(t => t.FEntrySelfP0251).HasColumnName("FEntrySelfP0251");
            this.Property(t => t.FEntrySelfP0252).HasColumnName("FEntrySelfP0252");
            this.Property(t => t.FEntrySelfP0253).HasColumnName("FEntrySelfP0253");
        }
    }
}
